package org.hs.phd.odi.tracking.performanceevaluation;

import java.awt.Polygon;
import java.util.ArrayList;
import java.util.List;

import org.hs.phd.common.simpleplayer.ImageSequenceFrame;

public class TrackingPerformanceStatistics {

	private List<TrackingPerformanceMetric> metrics;

	public TrackingPerformanceStatistics() {
		metrics = new ArrayList<TrackingPerformanceMetric>();
	}

	public void addMetric(TrackingPerformanceMetric metric) {
		metrics.add(metric);
	}

	public void update(ImageSequenceFrame input, Polygon groundTruthShape, Polygon trackShape) {
		for(TrackingPerformanceMetric metric:metrics){
			metric.update(input, groundTruthShape, trackShape);
		}
	}
	
	public Iterable<TrackingPerformanceMetric> iterator(){
		return metrics;
	}

	public TrackingPerformanceStatistics getCopy() {
		TrackingPerformanceStatistics copy = new TrackingPerformanceStatistics();
		
		for(TrackingPerformanceMetric metric:metrics){
			copy.addMetric(metric.clone());
		}
		
		return copy;
	}


}
